<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>我的设备</title>
    <link href="css/swiper.min.css" rel="stylesheet"/>
    <link href="css/public.css" rel="stylesheet"/>
    <link href="css/main.css" rel="stylesheet"/>
    <link href="css/style.css" rel="stylesheet"/>
	<script src="http://www.jq22.com/jquery/jquery-1.9.1.js"></script>
	<script src="js/mobile-util.js"></script>
    <script src="js/public.js"></script>

	<style>
		.device-null{
			position: relative;
			margin-top: 4rem;
			display: none;
		}
		.device-null p:first-child{
			text-align: center;
			font-size: 3rem;
		}
		.devicelist{
			display: none;

		}
		.tiship{
			font-size: .6rem;
			text-align: center;
			color: #555;
			position: relative;
			margin-top: 1rem;
		}
		.deviceicon{
			color: #008BD5;
		}
		.realui td{
			padding: .5rem 0;
		}

		.wifilogo{
			width: 1.2rem;
		}

		.deviceleft{
			position: relative;
			top: .7rem;
		}

		body{
			background: #F0EFF5!important;
		}

		.devicemain{
			background: url("img/beijing.png") top center no-repeat ;
			height: 23rem;
			width: 100%;
			background-size: 100%;
			margin-top: -1.7rem;
			overflow-y: auto;
		}
		.recordmain{
			margin: 2rem 0 0 0;
		}

		.deviceinfolist{
			margin: 3.5rem 1rem 0 1rem;
			height: 19.5rem;
			overflow-y: auto;
		}

		.devicecode{
			width: 5.2rem;
		}

		.realui td{
			padding: .5rem;
		}
		.realui tr{
			border-bottom: .03rem solid #73bfe8;
		}

		.rechargebtn1{
			background: transparent;
			color: #7cb6e3;
			border: .03rem solid #7cb6e3;
			padding: .2rem .8rem;
			border-radius: .2rem;
		}
	</style>

</head>
<body>

<header class="mui-bar mui-bar-nav indexheader flex" style="background: #008BD5">
	<div class="headerlogo hide">
		<i class="iconfont backbtn">&#xe602;</i>
	</div>

	<div class="headertitle">
		<p style="color: white">我的设备</p>
	</div>

	<div class="headerright timeright hide">
		<p class="timepbox iconfont">&#xe6d9;</p>

	</div>

</header>


<main class="recordmain" >

	<div class="device-null" style="margin-top:2rem ;float: left;width: 100%;">
		<p class="iconfont deviceicon" style="position: relative;margin-top: 2rem">&#xe6ed;</p>
		<p class="tiship">您还没有购买设备！</p>

		<div class="ma-speen-5">
			<input type="button" value="了解wifi设备"  onclick="website()"  class="rechargebtn">
		</div>

	</div>

	<div class="devicelist" >

		<div class="deviceleft" style="margin: 0 .7rem">
			<table cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td width="15%">
						<img src="img/wifi.png" class="wifilogo">
					</td>
					<td width="85%">
						<h3 style="font-size: .8rem;color: #000000">您有<span id="devicenum" style="font-size: 1rem;color: #000000;top: -.1rem;position: relative">4</span>台设备</h3>
						<p style="font-size: .65rem;color: #7C7C7C;margin-top: .3rem">默认密码为admin</p>
					</td>
				</tr>
			</table>
		</div>

		<div class="devicemain">
			<div class="deviceinfolist">
				<table class="realui" width="100%" cellpadding="0" cellspacing="0">
					<!--<tr>-->
						<!--<td width="40%">-->
							<!--<img src="img/banner1.gif" class="devicecode">-->
						<!--</td>-->

						<!--<td width="60%" align="left">-->
							<!--<p style="font-size: .6rem;color: #000">设备号：</p>-->
							<!--<p style="font-size: .6rem;color: #000;margin-top: .5rem">4353453453453434</p>-->
							<!--<p style="margin-top: .6rem">-->
								<!--<input type="button" value="了解wifi设备"  onclick="website()"  class="rechargebtn1">-->
							<!--</p>-->
						<!--</td>-->
					<!--</tr>-->


				</table>
			</div>
		</div>

		<!--<p style="padding-top: .5rem;font-size: .6rem">您有<span style="font-size: .6rem" ></span>个设备</p>-->
		<!--<p style="padding: .3rem 0;color: #EB3F47;font-size: .6rem">默认为密码为admin</p>-->


	</div>


</main>

</body>

<script>


	function website(){
		window.location.href="http://qlhwifi.qianlh.com";
	}
	
    var url="http://wifi.qianlh.com";
	//var url="http://192.168.0.132:69";
    var url1=url+"/Mobile/Userapi/getDeviceByuserid";

    $(function () {

        var cce;
        cee = setTimeout(function(){
            $('.markbox').hide();
            clearTimeout(cce);

        }, 1000);


        $.ajax({
            type:'get',
            url:url1,
            success:function(data){



                var data1=JSON.parse(data);
				//console.log(data1);
				//alert(data1);

                if(data1.success.code==4000){
					var device=data1.Device.length;

					if(!device==0){

						$('.devicelist').show();
						$('.device-null').hide();
						$('#devicenum').html(device);

						var str="";
						// '<td><a href="http://wechat.mifidata.com/html/device.html">设置密码</a></td>'+
						for(var i=0;i<data1.Device.length;i++){
							str+='<tr >' +

									'<td width="50%">'+
									'<a href="http://wifi.qianlh.com/mobile/login.html?device_sn='+ data1.Device[i].device_sn +'"> <img src="'+data1.Device[i].QRcode+'" class="devicecode"></a>'+
									'</td>'+
									'<td width="50%" align="left">'+
									'<p style="font-size: .6rem;color: #000">设备号：</p>'+
									'<p style="font-size: .8rem;color: #000;margin-top: .5rem">'+data1.Device[i].device_sn+'</p>'+
									'<p style="margin-top: .6rem"><input type="button" value="了解wifi设备"  onclick="website()"  class="rechargebtn1"></p>'+
									'</td>'+
									// '<td style="font-size: .6rem" >设备编号：</td>' +
									// '<td style="text-align: center">' +
									// '<img src="'+data1.Device[i].QRcode+'" alt="" style="width: 4rem">' +
									// '</td>' +

									'</tr>'
						}
						$('.realui').append(str);
					}else{
						$('.device-null').show();
					}



                }else if(data1.success.code==4008){
                	alert(data1.success.message);
                }


            },
            error:function (data) {
                    console.log("请检查您的网络！");
            }
        });



    });



</script>


</html>
